import httplib, urllib, urllib2


def rest(method, username, password, returnFormat=''):
	conn = httplib.HTTPConnection('723665fa6d9841e0a7f01e98c4cf7081.cloudapp.net') #, 63421)
	params = urllib.urlencode({"method" : method, 'username' : username, 'password' : password, 'reponseFormat' : returnFormat})
	headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"}
	conn.request('POST', '/restapi.ashx',  params, headers)
	response = conn.getresponse()
	print response.read()
	conn.close()

	

rest('test','test','test123')
rest('test','test','test122')
rest('tesx','test','test122')
#rest('test','test','test123', 'xml')
#rest('test','tesd','test123', 'xml')
#rest('tesx','test','test123', 'xml')
rest('test','test','test123', 'json')
rest('test','test','test12x', 'json')
rest('tesx','test','test123', 'json')
'''

url = 'http://localhost:63421/restapi.ashx'
params = urllib.urlencode({"method" : 'test', 'username' : 'test', 'password' : 'test123'})
req = urllib2.Request(url, params)
response = urllib2.urlopen(req)
print response.read() 

'''